package com.wheesper.www.WheesperServer.Net.Session;

import java.util.HashMap;
import java.util.Map;
import io.netty.channel.*;


public class SessionManager {
	
	private static SessionManager _instance = new SessionManager();
	
	public static SessionManager Instance() {
		return _instance;
	}
	
	private Map<Integer,Session> _all_active_sessions;
	
	public SessionManager() {
		_all_active_sessions = new HashMap<Integer,Session>();
	}
	
	//Create a IOSession
	public IOSession newIOSession(Channel channel) {
		Session session = SessionFactory.Instance().createIOSession(channel);
		_all_active_sessions.put(session.getID(), session);
		return (IOSession)session;
	}
}
